from fastapi import APIRouter, Query
from Apps.mitm.mitm_server import get_data, search_data, get_total_documents

router = APIRouter(
    prefix="/mitm",
    tags=["mitm"],
    responses={404: {"description": "Not Found"}},
)


@router.get("/get_data", tags=["mitm"])
async def get_data_route(
        page: int = Query(1, ge=1),
        size: int = Query(10, ge=1)):
    return await get_data(page, size)


@router.get("/search_data", tags=["mitm"])
async def search_data_router(
        path: str = Query(...),
        page: int = Query(1, ge=1),
        size: int = Query(10, ge=1)
):
    return await search_data(path, page, size)
